async function fetchFromServer(){
    const response = await fetch('http://localhost:8080/api/employees');
    const data = await response.json();
    console.log(data);
    try {
        app.empList = data;
    } catch (error) {
        console.error('Error updating empList:', error);
        throw error; // Rethrow the error after logging it
    }
    
}




const app = Vue.createApp({
    data() {
        return {
            empList:[]
        }

    },
    methods: {
        async getTableData(){
        try {
            const result = await fetchFromServer()
            console.log(result)
            this.empList = result.data;
        } catch (error) {
            console.error('Error fetching data:', error);
        }
    }
},
mounted() {
    this.getTableData();
},
}).mount('#app');

